#pragma once
#include <string>
#include <functional>
#include <unordered_map>

using MessageHadler = std::function<void(std::string)>;
class MessageBus
{
public:
    MessageBus(){};
    ~MessageBus(){};

    void attach(const std::string& topic, MessageHadler&& messageHadler);
    void remove(const std::string& topic);
    void sendMsg(const std::string& topic, const std::string& msg);

private:
    std::unordered_map<std::string, MessageHadler> messageHandlers_;
};
